<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>MyBug系统--首页</title>
<link rel="stylesheet" type="text/css" href="css/result.css" />
<link rel="stylesheet" type="text/css" href="css/home.css" />
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>


</head>
<body>
	<jsp:include page="total.jsp"></jsp:include>

	<div class="logo"></div>
	<div class="to_input">
		<form action="buginfocontr/findbydescription" method="post">
			<input type="text" name="description" id="input" value="" /><input
				type="submit" value="BUG" id="bug" />

		</form>
		<div class="show"></div>
	</div>

	<div id="copyright">
		<table border="" cellspacing="" cellpadding="">
			<tr>
				<td><a href="">设置为首页</a>
				</td>
				<td><a href="">关于我们</a>
				</td>
			</tr>
			<tr></tr>
			<tr>
				<td>@ 2017 版权所有</td>
				<td>粤：IPC证030173号</td>
			</tr>

		</table>
	</div>

	<script type="text/javascript">
		$(function() {
			$("#input").on("keyup",function(even) {
						var str = $(this).val().trim();
						//console.log(str + "-----" + even.keyCode + "-----"
						//		+ str.length);
						if (str.length != 0) {
							$.ajax({
								url : "buginfocontr/findall?str="+str,
								success : function(msg) {
									//console.log(msg);
									$(".show").empty();
									$(".show").show();
									var obj = eval('(' + msg + ')');
									for ( var i = 0; i < obj.length; i++) {
									$(".show").append("<div class='show_a'><a href='buginfocontr/findbydescription?description="+obj[i]['description']+"'>"+obj[i]['description']+"</a></div>");
									$(".show_a").mouseover(function(){
										$(this).css("background-color","#dedede");
									});
									$(".show_a").mouseout(function(){
										$(this).css("background-color","white");
									});
									}
								}
							});
						}else{
							$(".show").hide();
						}
					});
		});
		
		
		$(function(){
			$(".show_a").mouseover(function(){
				$(this).css("background-color","#dedede");
			});
			$(".show_a").mouseout(function(){
				$(this).css("background-color","white");
			});
		});
	
	</script>
</body>
</html>
